const http = require("http");
const url = require("url");
const fs = require("fs");

http.createServer((req, res) => {

    res.writeHead(200, { "Content-type": "text/html;charset=UTF8" })
    fs.readFile("./form.html", (err, data) => {
        if (req.url == "/favicon.ico") {
            return;
        }

        let query = url.parse(req.url, true).query;
        let username = query.name;
        let age = query.age;

        res.end(`姓名：${username},年龄${age}`)
    })

}).listen(5000, "192.168.50.27")